Keyboard_ReMap = {}

Keyboard_ReMap[KEY_NONE] 	= 0
Keyboard_ReMap[KEY_0] 		= string.byte('0')
Keyboard_ReMap[KEY_1] 		= string.byte('1')
Keyboard_ReMap[KEY_2] 		= string.byte('2')
Keyboard_ReMap[KEY_3] 		= string.byte('3')
Keyboard_ReMap[KEY_4] 		= string.byte('4')
Keyboard_ReMap[KEY_5] 		= string.byte('5')
Keyboard_ReMap[KEY_6] 		= string.byte('6')
Keyboard_ReMap[KEY_7] 		= string.byte('7')
Keyboard_ReMap[KEY_8] 		= string.byte('8')
Keyboard_ReMap[KEY_9] 		= string.byte('9')
Keyboard_ReMap[KEY_A] 		= string.byte('a')
Keyboard_ReMap[KEY_B] 		= string.byte('b')
Keyboard_ReMap[KEY_C] 		= string.byte('c')
Keyboard_ReMap[KEY_D] 		= string.byte('d')
Keyboard_ReMap[KEY_E] 		= string.byte('e')
Keyboard_ReMap[KEY_F] 		= string.byte('f')
Keyboard_ReMap[KEY_G] 		= string.byte('g')
Keyboard_ReMap[KEY_H] 		= string.byte('h')
Keyboard_ReMap[KEY_I] 		= string.byte('i')
Keyboard_ReMap[KEY_J] 		= string.byte('j')
Keyboard_ReMap[KEY_K] 		= string.byte('k')
Keyboard_ReMap[KEY_L] 		= string.byte('l')
Keyboard_ReMap[KEY_M] 		= string.byte('m')
Keyboard_ReMap[KEY_N] 		= string.byte('n')
Keyboard_ReMap[KEY_O] 		= string.byte('o')
Keyboard_ReMap[KEY_P] 		= string.byte('p')
Keyboard_ReMap[KEY_Q] 		= string.byte('q')
Keyboard_ReMap[KEY_R] 		= string.byte('r')
Keyboard_ReMap[KEY_S] 		= string.byte('s')
Keyboard_ReMap[KEY_T] 		= string.byte('t')
Keyboard_ReMap[KEY_U] 		= string.byte('u')
Keyboard_ReMap[KEY_V] 		= string.byte('v')
Keyboard_ReMap[KEY_W] 		= string.byte('w')
Keyboard_ReMap[KEY_X] 		= string.byte('x')
Keyboard_ReMap[KEY_Y] 		= string.byte('y')
Keyboard_ReMap[KEY_Z] 		= string.byte('z')
Keyboard_ReMap[KEY_PAD_0] 	= 128
Keyboard_ReMap[KEY_PAD_1] 	= 129
Keyboard_ReMap[KEY_PAD_2] 	= 130
Keyboard_ReMap[KEY_PAD_3] 	= 131
Keyboard_ReMap[KEY_PAD_4] 	= 132
Keyboard_ReMap[KEY_PAD_5] 	= 133
Keyboard_ReMap[KEY_PAD_6] 	= 134
Keyboard_ReMap[KEY_PAD_7] 	= 135
Keyboard_ReMap[KEY_PAD_8] 	= 136
Keyboard_ReMap[KEY_PAD_9] 	= 137
Keyboard_ReMap[KEY_PAD_DIVIDE] 	= 138
Keyboard_ReMap[KEY_PAD_MULTIPLY]= 139
Keyboard_ReMap[KEY_PAD_MINUS] 	= 140
Keyboard_ReMap[KEY_PAD_PLUS] 	= 141
Keyboard_ReMap[KEY_PAD_ENTER] 	= 142
Keyboard_ReMap[KEY_PAD_DECIMAL] = 143
Keyboard_ReMap[KEY_LBRACKET] 	= string.byte('[')
Keyboard_ReMap[KEY_RBRACKET] 	= string.byte(']')
Keyboard_ReMap[KEY_SEMICOLON] 	= string.byte(';')
Keyboard_ReMap[KEY_APOSTROPHE] 	= string.byte('\'')
Keyboard_ReMap[KEY_BACKQUOTE] 	= string.byte('`')
Keyboard_ReMap[KEY_COMMA] 	= string.byte(',')
Keyboard_ReMap[KEY_PERIOD] 	= string.byte('.')
Keyboard_ReMap[KEY_SLASH] 	= string.byte('/')
Keyboard_ReMap[KEY_BACKSLASH] 	= string.byte('\\')
Keyboard_ReMap[KEY_MINUS] 	= string.byte('-')
Keyboard_ReMap[KEY_EQUAL] 	= string.byte('=')
Keyboard_ReMap[KEY_ENTER] 	= 13
Keyboard_ReMap[KEY_SPACE] 	= string.byte(' ')
Keyboard_ReMap[KEY_BACKSPACE] 	= 127
Keyboard_ReMap[KEY_TAB] 	= 9
Keyboard_ReMap[KEY_CAPSLOCK] 	= 144
Keyboard_ReMap[KEY_NUMLOCK] 	= 145
Keyboard_ReMap[KEY_ESCAPE] 	= 18
Keyboard_ReMap[KEY_SCROLLLOCK] 	= 146
Keyboard_ReMap[KEY_INSERT] 	= 147
Keyboard_ReMap[KEY_DELETE] 	= 148
Keyboard_ReMap[KEY_HOME] 	= 149
Keyboard_ReMap[KEY_END] 	= 150
Keyboard_ReMap[KEY_PAGEUP] 	= 151
Keyboard_ReMap[KEY_PAGEDOWN] 	= 152
Keyboard_ReMap[KEY_BREAK] 	= 153
Keyboard_ReMap[KEY_LSHIFT] 	= 154
Keyboard_ReMap[KEY_RSHIFT] 	= 155
Keyboard_ReMap[KEY_LALT] 	= 156
Keyboard_ReMap[KEY_RALT] 	= 157
Keyboard_ReMap[KEY_LCONTROL] 	= 158
Keyboard_ReMap[KEY_RCONTROL] 	= 159
Keyboard_ReMap[KEY_LWIN] 	= 160
Keyboard_ReMap[KEY_RWIN] 	= 161
Keyboard_ReMap[KEY_APP] 	= 162
Keyboard_ReMap[KEY_UP] 		= 17
Keyboard_ReMap[KEY_LEFT] 	= 19
Keyboard_ReMap[KEY_DOWN] 	= 18
Keyboard_ReMap[KEY_RIGHT] 	= 20
Keyboard_ReMap[KEY_F1] 		= 163
Keyboard_ReMap[KEY_F2] 		= 164
Keyboard_ReMap[KEY_F3] 		= 165
Keyboard_ReMap[KEY_F4] 		= 166
Keyboard_ReMap[KEY_F5] 		= 167
Keyboard_ReMap[KEY_F6] 		= 168
Keyboard_ReMap[KEY_F7] 		= 169
Keyboard_ReMap[KEY_F8] 		= 170
Keyboard_ReMap[KEY_F9] 		= 171
Keyboard_ReMap[KEY_F10] 	= 172
Keyboard_ReMap[KEY_F11] 	= 173
Keyboard_ReMap[KEY_F12] 	= 174
Keyboard_ReMap[KEY_CAPSLOCKTOGGLE]	= 175
Keyboard_ReMap[KEY_NUMLOCKTOGGLE]	= 176
Keyboard_ReMap[KEY_SCROLLLOCKTOGGLE]	= 177
Keyboard_ReMap[KEY_XBUTTON_UP] 		= 200
Keyboard_ReMap[KEY_XBUTTON_DOWN]	= 201
Keyboard_ReMap[KEY_XBUTTON_LEFT]	= 202
Keyboard_ReMap[KEY_XBUTTON_RIGHT]	= 203
Keyboard_ReMap[KEY_XBUTTON_START]	= 204
Keyboard_ReMap[KEY_XBUTTON_BACK]	= 205
Keyboard_ReMap[KEY_XBUTTON_STICK1]	= 206
Keyboard_ReMap[KEY_XBUTTON_STICK2]	= 207
Keyboard_ReMap[KEY_XBUTTON_A] 		= 208
Keyboard_ReMap[KEY_XBUTTON_B] 		= 209
Keyboard_ReMap[KEY_XBUTTON_X] 		= 210
Keyboard_ReMap[KEY_XBUTTON_Y] 		= 211
--Keyboard_ReMap[KEY_XBUTTON_BLACK] 	= 212
--Keyboard_ReMap[KEY_XBUTTON_WHITE] 	= 213
Keyboard_ReMap[KEY_XBUTTON_LTRIGGER] 	= 214
Keyboard_ReMap[KEY_XBUTTON_RTRIGGER] 	= 215
Keyboard_ReMap[KEY_XSTICK1_UP] 		= 216
Keyboard_ReMap[KEY_XSTICK1_DOWN] 	= 217
Keyboard_ReMap[KEY_XSTICK1_LEFT] 	= 218
Keyboard_ReMap[KEY_XSTICK1_RIGHT] 	= 219
Keyboard_ReMap[KEY_XSTICK2_UP] 		= 220
Keyboard_ReMap[KEY_XSTICK2_DOWN] 	= 221
Keyboard_ReMap[KEY_XSTICK2_LEFT] 	= 222
Keyboard_ReMap[KEY_XSTICK2_RIGHT] 	= 223

Keyboard_CaseReMap = {}
Keyboard_CaseReMap["a"] = "A"
Keyboard_CaseReMap["b"] = "B"
Keyboard_CaseReMap["c"] = "C"
Keyboard_CaseReMap["d"] = "D"
Keyboard_CaseReMap["e"] = "E"
Keyboard_CaseReMap["f"] = "F"
Keyboard_CaseReMap["g"] = "G"
Keyboard_CaseReMap["h"] = "H"
Keyboard_CaseReMap["i"] = "I"
Keyboard_CaseReMap["j"] = "J"
Keyboard_CaseReMap["k"] = "K"
Keyboard_CaseReMap["l"] = "L"
Keyboard_CaseReMap["m"] = "M"
Keyboard_CaseReMap["n"] = "N"
Keyboard_CaseReMap["o"] = "O"
Keyboard_CaseReMap["p"] = "P"
Keyboard_CaseReMap["q"] = "Q"
Keyboard_CaseReMap["r"] = "R"
Keyboard_CaseReMap["s"] = "S"
Keyboard_CaseReMap["t"] = "T"
Keyboard_CaseReMap["u"] = "U"
Keyboard_CaseReMap["v"] = "V"
Keyboard_CaseReMap["w"] = "W"
Keyboard_CaseReMap["x"] = "X"
Keyboard_CaseReMap["y"] = "Y"
Keyboard_CaseReMap["z"] = "Z"
Keyboard_CaseReMap["1"] = "!"
Keyboard_CaseReMap["2"] = "@"
Keyboard_CaseReMap["3"] = "#"
Keyboard_CaseReMap["4"] = "$"
Keyboard_CaseReMap["5"] = "%"
Keyboard_CaseReMap["6"] = "^"
Keyboard_CaseReMap["7"] = "&"
Keyboard_CaseReMap["8"] = "*"
Keyboard_CaseReMap["9"] = "("
Keyboard_CaseReMap["0"] = ")"
Keyboard_CaseReMap["-"] = "_"
Keyboard_CaseReMap["="] = "+"
Keyboard_CaseReMap["\\"] = "|"
Keyboard_CaseReMap["["] = "{"
Keyboard_CaseReMap["]"] = "}"
Keyboard_CaseReMap[";"] = ":"
Keyboard_CaseReMap["'"] = "\""
Keyboard_CaseReMap[","] = "<"
Keyboard_CaseReMap["."] = ">"
Keyboard_CaseReMap["/"] = "?"